package com.example.chcrm.entity.vehicle;

import com.baomidou.mybatisplus.annotation.*;
import com.example.chcrm.entity.common.OperateRecord;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @Author 邹
 * @Date 2025/4/24 0:47
 * @Version 1.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class TransportPlanCv implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.INPUT)
    private String id;
    @NotBlank(message = "委托商id不能为空")
    private String consignorId;     //委托商id
    @Excel(name = "委托商",width = 20)
    @NotBlank(message = "委托商不能为空")
    private String consignorName;   //委托商名称
    @Excel(name = "批次号",width = 20)
    @NotBlank(message = "批次号不能为空")
    private String batchNumber;     //批次号
    private String planNumber;      //计划编号
    @Excel(name = "运输方式",width = 10,replace = {"公路_1","水路_2","水陆联运_3"})
    @NotNull(message = "运输方式不能为空")
    private Integer transportMode;  //运输方式  1：公路 2：水路 3：水陆联运
    @Excel(name = "委托车数量",width = 10)
    @NotNull(message = "委托车数量不能为空")
    private Integer planCount;          //委托车数量
    private Integer leftoverPlanCount;  //剩余委托车数量

    private Integer state;          //状态 0待执行 1执行中 2已完成 -1已取消

    @TableLogic(value = "0", delval = "-1")
    private Integer isDeleted;
    @Excel(name = "创建时间",width = 30,format ="yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;    //创建时间

    @TableField(exist = false)
    private Integer page = 1;
    @TableField(exist = false)
    private Integer rows = 10;

    @TableField(exist = false)
    private List<OperateRecord> operateRecordList;  //操作记录
    @TableField(exist = false)
    private TransportChildCv transportChild;  //委托车查询条件
    @TableField(exist = false)
    private List<TransportChildCv> transportChildCvList;    //记录委托车信息表
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startTime; //开始时间
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endTime;   //结束时间
    @TableField(exist = false)
    private String startTime2;
    @TableField(exist = false)
    private String endTime2;


    @TableField(exist = false)
    private Integer addOrUpdate;    //新增、修改状态 0：新增 1：修改

    //如果有1辆车交车了就是1，没有则是0
    @TableField(exist = false)
    private Integer status ;

}